import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
// 双向数据绑定必须引入FormsModule
//要使用响应式表单控件，就要从 @angular/forms 包中导入 ReactiveFormsModule，并把它添加到你的 NgModule 的 imports 数组中
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
//要想使用 HttpClient，就要先导入 Angular 的 HttpClientModule。大多数应用都会在根模块 AppModule 中导入它。
import {HttpClientModule, HttpClientJsonpModule} from '@angular/common/http';


import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component';
import {ChildComponent} from './child/child.component';
// 引入自定义管道
import {ExponentialStrengthPipe} from './exponential-strength.pipe';
// 引入自定义指令
import {HighlightDirective} from './highlight.directive';
import {UnlessDirective} from './unless.directive';

import {FirstComponent} from './first/first.component';
import {SecondComponent} from './second/second.component';
import {NotFoundComponent} from './not-found/not-found.component';
import {ChildAComponent} from './child-a/child-a.component';
import {ChildBComponent} from './child-b/child-b.component';
import {NameEditorComponent} from './name-editor/name-editor.component';
import {ProfileEditorComponent} from './profile-editor/profile-editor.component';
import {NewsComponent} from './news/news.component';

// 引入服务
import {HttpServiceService} from './service/http-service.service';
import { HomeComponent } from './home/home.component';
import { HelloFormComponent } from './hello-form/hello-form.component'

@NgModule({
  declarations: [
    AppComponent,
    ChildComponent,
    ExponentialStrengthPipe,
    HighlightDirective,
    UnlessDirective,
    FirstComponent,
    SecondComponent,
    NotFoundComponent,
    ChildAComponent,
    ChildBComponent,
    NameEditorComponent,
    ProfileEditorComponent,
    NewsComponent,
    HomeComponent,
    HelloFormComponent
  ],
  imports: [
    FormsModule,
    ReactiveFormsModule,
    BrowserModule,
    AppRoutingModule,
    // import HttpClientModule after BrowserModule.
    HttpClientModule,
    HttpClientJsonpModule
  ],
  // 注入服务
  providers: [HttpServiceService],
  bootstrap: [AppComponent]
})
export class AppModule {
}
